@import '../../components/Grid/variables.scss';
@import '../../components/Form/variables.scss';
@import './variables.scss';

.grid {
    margin-bottom: -$sectionMarginBottom;
    contain: layout;
}

.grid-section {
    margin-bottom: -$fieldMarginBottom;

    &:first-child {
        /* the first section divider should not have a margin top */
        > .divider-container > :first-child {
            margin-top: 0;
        }
    }

    &:last-child {
        margin-bottom: 0;
    }

    & + .grid-item {
        margin-top: $fieldMarginBottom;
    }
}

.grid-item + .grid-section {
    margin-top: -$fieldMarginBottom;
}

@media (max-width: $gridMinWidth) {
    .grid-section + .grid-section {
        margin-top: $fieldMarginBottom;
    }
}
